﻿using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore;
using Mes.Domain.BoundedContext.Entities.MasterData;

namespace Mes.Infrastructure.Data.BoundedContext.EntityTypeConfigurations.MasterData
{
    public class MaterialClassEntityConfig : IEntityTypeConfiguration<MaterialClass>
    {
        public void Configure(EntityTypeBuilder<MaterialClass> builder)
        {
            builder.ToTable("materialclass");
            builder.Property(b => b.Code).HasMaxLength(50).IsRequired();
            builder.Property(b => b.Name).HasMaxLength(50).IsRequired();
            builder.Property(b => b.IsDeleted).HasDefaultValue(false).IsRequired();
            builder.Property(b => b.CreateTime).IsRequired();
            builder.Property(b => b.Updatetime).IsRequired();
            builder.Property(b => b.TypeId).IsRequired();
            builder.Property(b => b.TypeName).HasMaxLength(50).IsRequired();
        }
    }
}
